<template>
  <div>
    <div class="banner" @click="handelBannerClick()">
      <img class="banner-img"
           :src=bannerImg>
      <div class="banner-info">
        <div class="banner-num"><span class="iconfont arrow-icon">&#xe647;</span>
          5
        </div>
        <div class="banner-title">{{sightname}}</div>
      </div>
    </div>
    <div>
      <fade>
      <gallary :bannerImgs='bannerImgs' v-show="showgallary" @gallaryclose="gallaryclose"></gallary>
      </fade>
    </div>
  </div>
</template>

<script>
  import Gallary from 'common/gallary/Gallary'
  import Fade from 'common/fadeanimate/Fade'

  export default {
    name: "Banner",
    components: {
      gallary:Gallary,
      fade:Fade
    },
    props: {
      "gallary": Gallary,
      sightname:String,
      bannerImg:String,
      bannerImgs:Array
    },
    data() {
      return {
        showgallary: false
      }
    },
    methods: {
      handelBannerClick() {
        this.showgallary = true
      },
      gallaryclose() {
        this.showgallary = false
      }
    }
  }
</script>

<style lang="stylus" scoped>
  .banner {
    position relative
    overflow hidden
    height 0
    padding-bottom 55%

    .banner-img {
      width 100%
    }

    .banner-info {
      display flex
      flex-direction column
      position absolute
      left 0
      right 0
      bottom 0
      line-height .5rem
      color #ffffff
      background-image linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.7))

      .banner-title {
        flex 1
        font-size .36rem
        margin-bottom .32rem
        margin-left: .2rem
      }

      .banner-num {
        text-align center
        width 1.2rem
        height .4rem
        line-height .4rem
        border-radius .2rem
        background rgba(0, 0, 0, .5)
        font-size .24rem
        margin-left: .2rem
        margin-bottom .1rem
      }
    }
  }
</style>
